package jackson.src.day01;

/*
 * Author: JacksonCoder
 * FileName: constorMethd
 * Version: 1.0.0
 */
public class constorMethd {

    public static void main(String[] args) {
        System.out.println("this is constrMethd");
        //Animal a = new Animal();
        People ming = new People("jackson",123);
        System.out.println(ming.getAge());
        System.out.println(ming.getName());
    }
}

class People{
    private String name;

    private int age;

    public People(String name, int age){
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }


    public int getAge() {
        return age;
    }

}

class Animal{

    private String name;

    private int age;

    // 构造方法
    public  Animal(){

    }

    public Animal(String name) {
        this.name = name;
    }

    public Animal(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
}